import jsonp from 'jsonp'
import Vue from 'vue'
import settings from '@/settings'
Vue.prototype.jsonp = function (url, param) {
    return new Promise((resolve, reject) => {
        if (param) {
            let urlParam = "";
            for (let key in param) {
                urlParam = urlParam + key + "=" + param[key] + "&";
            }
            urlParam = urlParam.substring(0, urlParam.length - 1);
            url = url + "?" + urlParam;
        }
        jsonp(url, (err, data) => {
            if (err) {
                reject(err);
            } else {
                resolve(data);
            }
        });
    });
}
Vue.prototype.obd_server=settings.OBD_SERVER;